package tk.mystudio.web.action;

import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 登录管理器
 * @author <a href="mailto:jhezjkp@163.com">蒋昆朋</a>
 *
 */
public class LoginManagerAction {
	
	public String index() {
		Authentication auth = SecurityContextHolder.getContext().getAuthentication();
		if(auth!=null && auth.getClass()!=AnonymousAuthenticationToken.class) {
			return "index";
		}
		return "login";
	}
	
	public String loginSuccess() {
		//登录成功后的转向地址
		return "index";
	}

}
